using UnityEngine;
using System.Collections;

public class randomGen : MonoBehaviour {
public GameObject objectToGen;
public int numberToGen = 3;
bool isDone = false;
	// Use this for initialization
	void Start () {
		Vector3 pos = objectToGen.transform.position;
		pos.y = 25f;
		objectToGen.transform.position = pos;
	}
	
	// Update is called once per frame
	void Update () {
		if(isDone == false)
		{
			for(int i = 0; i < numberToGen; i++)
			{
				Vector3 pos = objectToGen.transform.position;
				pos.x = Random.Range(2035, -3);
				pos.z = Random.Range(1992, 5);
				objectToGen.transform.position = pos;
				Instantiate(objectToGen);
			}
			isDone = true;
		}
	}
}
